import Dispatch from '../utils/dispatch'

export const userDispatch = new Dispatch({
  add: ['/auiu-admin/admin/user/add', 'post'],
  get: ['/auiu-admin/admin/user/list', 'get'],
  update: ['/auiu-admin/admin/user/update', 'put'],
  delete: ['/auiu-admin/admin/user/delete', 'delete'],
  checkUsername: ['/auiu-admin/admin/user/checkUsername', 'get'],
  checkEmail: ['/auiu-admin/admin/user/checkEmail', 'get'],
  checkMobile: ['/auiu-admin/admin/user/checkMobile', 'get']
})

export const menuDispatch = new Dispatch({
  add: ['/auiu-admin/admin/menu/add', 'post'],
  get: ['/auiu-admin/admin/menu/get', 'get'],
  update: ['/auiu-admin/admin/menu/edit', 'put'],
  delete: ['/auiu-admin/admin/menu/delete', 'delete'],
  route: ['/auiu-admin/admin/menu/get', 'get']
})

export const roleDispatch = new Dispatch({
  add: ['/auiu-admin/admin/role/add', 'post'],
  get: ['/auiu-admin/admin/role/list', 'get'],
  roles: ['/auiu-admin/admin/role/getRolesNames', 'get'],
  update: ['/auiu-admin/admin/role/update', 'put'],
  delete: ['/auiu-admin/admin/role/delete', 'delete']
})

export const resourceDispatch = new Dispatch({
  add: ['/auiu-admin/admin/resource/add', 'post'],
  get: ['/auiu-admin/admin/resource/list', 'get'],
  getAll: ['/auiu-admin/admin/resource/allList', 'get'],
  update: ['/auiu-admin/admin/resource/update', 'put'],
  updateBatch: ['/auiu-admin/admin/resource/updateBatch', 'put'],
  delete: ['/auiu-admin/admin/resource/delete', 'delete'],
  allocResource: ['/auiu-admin/admin/resource/allocResource', 'post']
})

export const resourceCateDispatch = new Dispatch({
  add: ['/auiu-admin/admin/resource/category/add', 'post'],
  get: ['/auiu-admin/admin/resource/category/list', 'get'],
  getAll: ['/auiu-admin/admin/resource/category/allList', 'get'],
  update: ['/auiu-admin/admin/resource/category/update', 'put'],
  updateBatch: ['/auiu-admin/admin/resource/category/updateBatch', 'put'],
  delete: ['/auiu-admin/admin/resource/category/delete', 'delete']
})
